<!doctype html>



  


<html class="theme-next mist use-motion">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/vendors/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/vendors/font-awesome/css/font-awesome.min.css?v=4.4.0" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.0.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Continuous integration," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.0.1" />






<meta name="description" content="说明：Jenkins原名Hudson，是一种可拓展性很强的持续化集成与发布工具。">
<meta name="keywords" content="Continuous integration">
<meta property="og:type" content="article">
<meta property="og:title" content="Jenkins">
<meta property="og:url" content="http://bebetter.site/2017/01/12/Software/Continuous integration and delivery 持续集成与交付 CI&CD/Jenkins/index.html">
<meta property="og:site_name" content="gatewayzy">
<meta property="og:description" content="说明：Jenkins原名Hudson，是一种可拓展性很强的持续化集成与发布工具。">
<meta property="og:updated_time" content="2017-01-12T05:58:56.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Jenkins">
<meta name="twitter:description" content="说明：Jenkins原名Hudson，是一种可拓展性很强的持续化集成与发布工具。">



<script type="text/javascript" id="hexo.configuration">
  var NexT = window.NexT || {};
  var CONFIG = {
    scheme: 'Mist',
    sidebar: {"position":"right","display":"always"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: 0,
      author: '博主'
    }
  };
</script>




  <link rel="canonical" href="http://bebetter.site/2017/01/12/Software/Continuous integration and delivery 持续集成与交付 CI&CD/Jenkins/"/>

  <title> Jenkins | gatewayzy </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  










  
  
    
  

  <div class="container one-collumn sidebar-position-right page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">gatewayzy</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">blog of gatewayzy</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>

 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  
  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                Jenkins
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            <span class="post-meta-item-icon">
              <i class="fa fa-calendar-o"></i>
            </span>
            <span class="post-meta-item-text">发表于</span>
            <time itemprop="dateCreated" datetime="2017-01-12T13:58:10+08:00" content="2017-01-12">
              2017-01-12
            </time>
          </span>

          
            <span class="post-category" >
              &nbsp; | &nbsp;
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="https://schema.org/Thing">
                  <a href="/categories/Softwares/" itemprop="url" rel="index">
                    <span itemprop="name">Softwares</span>
                  </a>
                </span>

                
                

              
            </span>
          

          
            
          

          

          
          

          
        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <p><strong>说明：</strong>Jenkins原名Hudson，是一种可拓展性很强的持续化集成与发布工具。<br><a id="more"></a></p>
<hr>
<p>参考文章：</p>
<h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><hr>
<ul>
<li>Jenkins的前身是Hudson，是一个基于java开发的持续集成工具，用于监控程序重复性工作，如：持续的软件版本发布/测试项目，监控外部调用执行的工作。</li>
<li>Jenkins特性：<ul>
<li>易于安装-只要把hudson.war部署到servlet容器，不需要数据库支持。</li>
<li>易于配置-所有配置都是通过其提供的web界面实现。</li>
<li>集成RSS/E-mail/IM-通过RSS发布构建结果或当构建失败时通过e-mail实时通知。</li>
<li>生成JUnit/TestNG测试报告。</li>
<li>分布式构建支持-Hudson能够让多台计算机一起构建/测试。</li>
<li>文件识别- Hudson能够跟踪哪次构建生成哪些jar，哪次构建使用哪个版本的jar等。</li>
<li>插件支持-Hudson可以通过插件扩展，你可以开发适合自己团队使用的工具。</li>
</ul>
</li>
</ul>
<h2 id="Hudson安装启动"><a href="#Hudson安装启动" class="headerlink" title="Hudson安装启动"></a>Hudson安装启动</h2><hr>
<ul>
<li>下载hudson.war包，配置好jdk环境变量。其默认工作空间在user/.hudson下，可设置环境变量HUDSON_HOME指定路径。</li>
<li>注意：hudson路径中不能有特殊字符，测试发现连空格都不能有。</li>
</ul>
<h3 id="Java-–jar启动hudson"><a href="#Java-–jar启动hudson" class="headerlink" title="Java –jar启动hudson"></a>Java –jar启动hudson</h3><ul>
<li>切换到jenkins.war存放的目录，输入如下命令：$ java -jar jenkins.war，然后在浏览器中输入localhost:8080即可。</li>
</ul>
<h3 id="第二种方法是用tomcat等打开"><a href="#第二种方法是用tomcat等打开" class="headerlink" title="第二种方法是用tomcat等打开"></a>第二种方法是用tomcat等打开</h3><ul>
<li>将jenkins.war文件放入tomcat下的webapps目录下，启动startup.sh来发布jenkins。访问<code>http://localhost:8080/hudson/</code>。可以把该tomcat进行设置成开机启动的服务从而将Jenkins设为系统服务。</li>
<li>为了防止Jenkins运行端口与所要发布项目发生端口冲突，应该把Jenkins的servlet容器端口修改。</li>
</ul>
<h2 id="构建项目环境"><a href="#构建项目环境" class="headerlink" title="构建项目环境"></a>构建项目环境</h2><hr>
<ul>
<li>在“系统管理”面板中配置构建项目需要的各种软件。具体步骤包括：<ul>
<li>选择要安装的插件。</li>
<li>配置jdk、svn、smtp等参数。</li>
<li>新建项目，配置好svn等，选择build trigger为poll SCM是版本更新即构建。</li>
</ul>
</li>
<li>Hudson的项目存放在HUDSON_HOME的jobs/项目/workspace。</li>
</ul>
<h2 id="问题与解决"><a href="#问题与解决" class="headerlink" title="问题与解决"></a>问题与解决</h2><hr>
<h3 id="Executing-Maven-出错"><a href="#Executing-Maven-出错" class="headerlink" title="Executing Maven 出错"></a>Executing Maven 出错</h3><ul>
<li>问题描述：命令行查看构建构成提示错误为：<br>Executing Maven:  -B -f /var/lib/jenkins/jobs/Omri/workspace/pom.xml –install… …<br>java.lang.reflect.InvocationTargetException<br>Caused by: java.lang.NoClassDefFoundError: org/apache/maven/cli/MavenLoggerManager<br>  at org.jvnet.hudson.maven3.launcher.Maven3Launcher.main(Maven3Launcher.java:73)</li>
<li>出错原因：这是由于hudson版本和maven版本不兼容导致</li>
<li>解决方法：可以更换稳定的maven，如使用3.0.5版本构建即可。</li>
</ul>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/Continuous-integration/" rel="tag">#Continuous integration</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2017/01/12/Software/Integrated development environment 继承开发环境 IDE/Eclipse/" rel="next" title="Eclipse">
                <i class="fa fa-chevron-left"></i> Eclipse
              </a>
            
          </div>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2017/01/12/Software/Java Web/JFinal/" rel="prev" title="JFinal">
                JFinal <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    


  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel ">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/statics/images/avatar.png"
               alt="gatewayzy" />
          <p class="site-author-name" itemprop="name">gatewayzy</p>
          <p class="site-description motion-element" itemprop="description">blog website with hexo and github pages</p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">70</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">10</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">38</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              友情链接
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="https://github.com/gatewayzy" title="Github-gatewayzy" target="_blank">Github-gatewayzy</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://google.com/" title="Goolge" target="_blank">Goolge</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://wiki.jikexueyuan.com/" title="Wiki-jike" target="_blank">Wiki-jike</a>
                </li>
              
            </ul>
          </div>
        

      </section>

      
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">
            
              
            
            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#简介"><span class="nav-number">1.</span> <span class="nav-text">简介</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Hudson安装启动"><span class="nav-number">2.</span> <span class="nav-text">Hudson安装启动</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Java-–jar启动hudson"><span class="nav-number">2.1.</span> <span class="nav-text">Java –jar启动hudson</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#第二种方法是用tomcat等打开"><span class="nav-number">2.2.</span> <span class="nav-text">第二种方法是用tomcat等打开</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#构建项目环境"><span class="nav-number">3.</span> <span class="nav-text">构建项目环境</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#问题与解决"><span class="nav-number">4.</span> <span class="nav-text">问题与解决</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#Executing-Maven-出错"><span class="nav-number">4.1.</span> <span class="nav-text">Executing Maven 出错</span></a></li></ol></li></ol></div>
            
          </div>
        </section>
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2018</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">gatewayzy</span>
</div>

<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>

        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/vendors/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/vendors/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/vendors/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/vendors/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.0.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.0.1"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.0.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.0.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.0.1"></script>



  



  




  
  

  
  <script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
        processEscapes: true,
        skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
      }
    });
  </script>

  <script type="text/x-mathjax-config">
    MathJax.Hub.Queue(function() {
      var all = MathJax.Hub.getAllJax(), i;
      for (i=0; i < all.length; i += 1) {
        all[i].SourceElement().parentNode.className += ' has-jax';
      }
    });
  </script>
  <script type="text/javascript" src="//cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>



  

  
<script type="text/javascript" async src="//push.zhanzhang.baidu.com/push.js">
</script>


</body>
</html>
